<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../CPUIAdmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../CPUIAdmin/style/admin.css" media="all">
    <link rel="stylesheet" href="../CPUIAdmin/style/login.css" media="all">
    <!-- particles.js container -->
    <link rel="stylesheet" href="../CPUIAdmin/js/particles.js/css/login.css" media="all">
</head>

<body>
    <!-- particles.js container -->
    <div id="particles-js" style="display: flex;align-items: center;justify-content: center">
    </div>

    <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login">

        <div class="layadmin-user-login-main login-content">
            <div class="layadmin-user-login-box layadmin-user-login-header">
                <h2>CPUIAdmin后台登录</h2>
                <p>一站式CMS系统</p>
            </div>
            <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-username"
                        for="LAY-user-login-username"></label>
                    <input type="text" name="username" id="LAY-user-login-username" lay-verify="required"
                        placeholder="用户名" class="layui-input" value="1">
                </div>
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-password"
                        for="LAY-user-login-password"></label>
                    <input type="password" name="password" id="LAY-user-login-password" lay-verify="required"
                        placeholder="密码" class="layui-input" value="1">
                </div>
                <div class="layui-form-item">
                    <div class="layui-row">
                        <div class="layui-col-xs7">
                            <label class="layadmin-user-login-icon layui-icon layui-icon-vercode"
                                for="LAY-user-login-vercode"></label>
                            <input type="text" name="vercode" id="LAY-user-login-vercode" lay-verify="required"
                                placeholder="图形验证码" class="layui-input" value="1">
                        </div>
                        <div class="layui-col-xs5">
                            <div style="margin-left: 10px;">
                                <img src="https://www.oschina.net/action/user/captcha"
                                    class="layadmin-user-login-codeimg" id="LAY-user-get-vercode">
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <input id="cp_submit" type="submit" lay-submit class="layui-btn layui-btn-fluid layui-btn-normal"
                        lay-filter="LAY-user-login-submit" value="登录" />
                </div>

            </div>
        </div>

        <div class="layui-trans layadmin-user-login-footer">
            <p><a href="http://www.gerenwaibao.com/" target="_blank" style="color:#1E9FFF;">www.gerenwaibao.com</a></p>
        </div>

    </div>

    <script src="../CPUIAdmin/layui/layui.js"></script>
    <script>
        layui.config({
            base: '../CPUIAdmin/' //静态资源所在路径
        }).extend({
            mymod: 'lib/mymod' //主入口模块
            , commons: 'lib/commons' //主入口模块
        }).use(['form', 'commons', 'ajaxs'], function () {
             
            var $ = layui.$
                ,setter = layui.setter
                , form = layui.form
                , ajaxs = layui.ajaxs
                , commons = layui.commons;
               
                // console.log(commons)
                
                // commons.msg("cccccc"); 
                // console.log(layui.setter)
                // ajaxs.ceshi();

            //提交
            form.on('submit(LAY-user-login-submit)', function (obj) {

                //请求登入接口
                ajaxs.post({
                    url: layui.setter.base + 'json/user/login.js?'+new Date().getTime() //实际使用请改成服务端真实接口
                    , data: obj.field
                    , login:true
                    , buttonID:"#cp_submit"
                    , success_status: function (res) {
                        console.log("========login=========")
                        console.log(res);

                   

                        if(res.code==1){
                        //登入成功的提示与跳转
                        layer.msg('登入成功', {
                              icon: 1
                            , time: 1000
                        },function(){
                            location.href = 'index.html'; //后台主页
                        });
                      }else{
                        layer.alert(res.msg, { title: "错误:", icon: 2 }); 
                      }
                    }
                    
                });

            });


           

        });
    </script>

    <!-- particles.js container -->
    <script src="../CPUIAdmin/js/particles.js/js/particles.js"></script>
    <script src="../CPUIAdmin/js/particles.js/js/app.js"></script>
</body>

</html>